﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using pfcls;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
         CCpfcAsyncConnection cAC = new CCpfcAsyncConnection();
        IpfcAsyncConnection iAC;
        iAC = cAC.Start("C:\\Program Files\\proeWildfire 4.0\\bin\\proe1.bat", ".");
        IpfcBaseSession bsession = (IpfcBaseSession)iAC.Session;

        CCpfcModelDescriptor descModel = new CCpfcModelDescriptor();

        IpfcModelDescriptor descmodel1 = descModel.CreateFromFileName("F:\\sec_develop\\PROE书稿\\model\\第十一章 VB与JLINK简介\\prt0001.prt");
        IpfcModel model = bsession.RetrieveModel(descmodel1);
        bsession.CreateModelWindow(model);
        model.Display();
    
        IpfcFamilyMember fammember;

        fammember = (IpfcFamilyMember)model;
     
          String InstanceName="instance123";
          double parvalue = double.Parse(DropDownList1.SelectedValue);
          IpfcParamValue pv;
          CMpfcModelItem zzz = new CMpfcModelItem();
          pv = zzz.CreateDoubleParamValue(parvalue);
    
     
        IpfcFamilyTableRow row=fammember.AddRow(InstanceName, null);

        IpfcFamilyTableColumn col=fammember.GetColumn("d1");
        fammember.SetCell(col, row, pv);
        IpfcModel model1 = row.CreateInstance(); 
        model1.Save();

    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}
